package com.example.cdctest.service.impl;

import com.example.cdctest.mapper.KnowledgeCollectionMapper;
import com.example.cdctest.pojo.KnowledgeCollection;
import com.example.cdctest.service.KnowledgeCollectionService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service("knowledgeCollectionService")
@Transactional(rollbackFor = Exception.class)
public class KnowledgeCollectionImpl implements KnowledgeCollectionService {
    @Resource
    private KnowledgeCollectionMapper knowledgeCollectionMapper;
    @Override
    public void collectionKnowledge(int userId, int knowledgeId) {
        knowledgeCollectionMapper.collectionKnowledge(userId,knowledgeId);
    }

    @Override
    public Boolean isCollection(Integer id, int knowledgeId) {
      return knowledgeCollectionMapper.isCollection(id,knowledgeId)!=0;
    }

    @Override
    public void deleteCollection(Integer id, int knowledgeId) {
        knowledgeCollectionMapper.deleteCollection(id,knowledgeId);
    }

    @Override
    public void insert(KnowledgeCollection object) {

    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(KnowledgeCollection object) {

    }

    @Override
    public KnowledgeCollection findById(Integer id) {
        return null;
    }

    @Override
    public List<KnowledgeCollection> findAll() {
        return null;
    }

    @Override
    public PageInfo<KnowledgeCollection> findPage(int pageSize) {
        return null;
    }
}
